package com.genius.reservation.order.controller;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.genius.reservation.common.ResponseRule;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 订单信息 前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2022-05-26
 */
@RestController
@RequestMapping("/reservation/order")
public class OrderInformationController {

    @RequestMapping("/GetOrderInfo")
    @ApiOperation("获取订单详情")
    public ResponseRule GetOrderInfo(@RequestParam("OrderNO") String OrderNO){
        String body = HttpRequest.get("http://39.107.83.199:8045/api/EditGoodsClass/GetOrderInfo?OrderNO=" + OrderNO).execute().body();
        return ResponseRule.ok(JSONUtil.parseArray(body),"ok");
    }
}
